using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class HealthBar : MonoBehaviour
{
    private Image healthBar;
    public Text healText;

    public static int curHealth;
    public static int totalHealth;
    
    // Start is called before the first frame update
    void Start()
    {
        healthBar = gameObject.GetComponent<Image>();
    }

    // Update is called once per frame
    void Update()
    {
        healthBar.fillAmount =  (float)curHealth / (float)totalHealth;
        healText.text = curHealth.ToString() + '/' + totalHealth.ToString();
    }
}
